Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added AMC Warranty filters and expiry labels for assets #6364

Merged
merged 6 commits into from
Oct 9, 2023

Conversation

GokulramGHV
Copy link
Member

@GokulramGHV GokulramGHV commented Sep 28, 2023

WHAT

🤖 Generated by Copilot at e18d241

The pull request adds a new feature to manage assets by their warranty or AMC end of validity. It allows users to filter assets by date range, see the status of the warranty or AMC in a chip component, and export the filtered data. It modifies the files AssetFilter.tsx, AssetManage.tsx, and AssetsList.tsx to implement this feature.

Proposed Changes

@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers

Merge Checklist

  • Add specs that demonstrate bug / test a new feature.
  • Update product documentation.
  • Ensure that UI text is kept in I18n files.
  • Prep screenshot or demo video for changelog entry, and attach it to issue.
  • Request for Peer Reviews
  • Completion of QA

HOW

🤖 Generated by Copilot at e18d241

  • Add a new feature to filter assets by warranty or AMC end of validity date range (link, link, link, link, link, link, link, link, link, link, link, link)
  • Import modules and components for date range form field, date library, type definition, and utility function in AssetFilter.tsx (link)
  • Define a helper function to convert a value to a valid date object in AssetFilter.tsx (link)
  • Add a state variable to store the before and after values of the date range filter in AssetFilter.tsx (link)
  • Add the state values to the query parameters for fetching the filtered assets from the API in AssetFilter.tsx (link)
  • Define a handler function to update the state when the date range form field changes in AssetFilter.tsx (link)
  • Render a date range form field component with the name, label, value, onChange, and errorClassName props in AssetFilter.tsx (link)
  • Import a function to render a chip component based on the warranty or AMC end of validity value in AssetManage.tsx (link)
  • Render the chip component using the imported function and the asset's warranty or AMC end of validity value in AssetManage.tsx (link)
  • Add the warranty or AMC end of validity before and after values to the query parameters object for fetching the assets from the API in AssetsList.tsx (link)
  • Add the warranty or AMC end of validity before and after values to the dependency array of the useEffect hook for fetching the assets from the API in AssetsList.tsx (link)
  • Render the chip component using the same function and the asset's warranty or AMC end of validity value in the table row of each asset in AssetsList.tsx (link)
  • Add the warranty or AMC end of validity before and after values to the CSV export data for the filtered assets in AssetsList.tsx (link)
  • Define and export a function to render a chip component based on the warranty or AMC end of validity value in AssetsList.tsx (link)

@GokulramGHV GokulramGHV requested a review from a team September 28, 2023 12:56
@GokulramGHV GokulramGHV requested a review from a team as a code owner September 28, 2023 12:56
@vercel
Copy link

vercel bot commented Sep 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
care-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 9, 2023 8:24am

@netlify
Copy link

netlify bot commented Sep 28, 2023

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit 02e05cd
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/6523b8a57b297c000871d04a
😎 Deploy Preview https://deploy-preview-6364--care-egov-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@nihal467
Copy link
Member

nihal467 commented Oct 3, 2023

@GokulramGHV
image

https://deploy-preview-6364--care-net.netlify.app/facility/45d45bb6-c48e-4883-984d-ac602ef7df1e/assets/2e961231-56cd-4b1b-abc2-0154ca96b660/update

the above asset has a warranty (31/01/2024) and today's date is (03/10/2023), as per the issue, the label should be coming from 3 months, but the above asset has more than 3 months exactly saying and the expiring label is shown to this asset

Note: if i make the warranty to any date in February, the warning is disappeared.

  1. Was it intentional behavior, and discussed in the EOD call?

@nihal467
Copy link
Member

nihal467 commented Oct 9, 2023

@GokulramGHV i have assigned you the cypress issue for this feature, work on it as a separate PR or along with this PR

@nihal467
Copy link
Member

nihal467 commented Oct 9, 2023

@GokulramGHV
image

it is less than 3 months, and the alert is not working properly, make sure you cover all the edge cases, and mark it or testing

@GokulramGHV
Copy link
Member Author

@GokulramGHV image

it is less than 3 months, and the alert is not working properly, make sure you cover all the edge cases, and mark it or testing

@nihal467 the no. of days between today and 8th of january is 91 days, I'm considering 90 days to be 3 months. So that is the reason why it doesn't show the label

@nihal467
Copy link
Member

nihal467 commented Oct 9, 2023

LGTM, @GokulramGHV i have assigned you the cypress test related to this, you can create a separate PR for that

@khavinshankar khavinshankar merged commit 10179d3 into coronasafe:develop Oct 9, 2023
31 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tracking Expiry of AMC/Warranty in CARE
3 participants